package com.lily.aidouzixun.ui;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

/**
 * 画圆
 */
public class PointView extends View{
	private Paint mPaint;
	private int color;
	private float size;
	public PointView(Context context) {
		this(context, null);
	}
	public PointView(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
	}
	public PointView(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
		mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
	}
	
	public void setColor(int color){
		this.color = color;
	}
	
	public void setSize(float size){
		this.size = size;
	}
	
	public void setColorAndSize(int color,float size){
		this.color = color;
		this.size = size;
	}
	/**
	 * 画画
	 */
	@Override
	protected void onDraw(Canvas canvas) {
		// TODO Auto-generated method stub
		super.onDraw(canvas);
		mPaint.setColor(color);
		canvas.drawCircle(size, size, size, mPaint);
	}
}
